﻿CREATE VIEW [dbo].[ASMS_V_Automobile]
	AS 
SELECT A.*,
	MDIIC.Name as InsuranceCompanyName,
	MDIB.Name as BrandName,
	MDIM.Name as MakerName,
	MDIS.Name as SeriesName,
	MDIModel.Name as ModelName
FROM [ASMS_Automobile] as A
	left join [ASMS_MasterDataItem] as MDIIC on MDIIC.Code= A.InsuranceCompany
	left join [ASMS_MasterDataItem] as MDIB on MDIB.Code= A.Brand
	left join [ASMS_MasterDataItem] as MDIM on MDIM.Code= A.Maker
	left join [ASMS_MasterDataItem] as MDIS on MDIS.Code= A.Series
	left join [ASMS_MasterDataItem] as MDIModel on MDIModel.Code= A.Model
